﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NIP.Speech.Dialog.States
{
    public class ActionInProgressDialogState: DialogStateBase, IDialogState
    {
        public ActionInProgressDialogState()
            : base(DialogStateType.Action_In_Progress)
        {
            
        }
        new public bool PreConditionCheck()
        {
            return true;
        }
        new public EventArgs.StateStatusEventArgs VoiceCommandResponse(Dictionary<string, string> recognizedText)
        {
            var args = new EventArgs.StateStatusEventArgs();
            if (recognizedText.ContainsValue("stop"))
            {
                args.Type = EventArgs.StateStatusEventTypes.ACTION_REQUESTED;
                args.ActionRequested = "stop";
                args.nextState = Responder.StateCreator(DialogStateType.IdleDialogState);
                args.ToSpeak = "Stopping now";
            }
            else
            {
                args.Type = EventArgs.StateStatusEventTypes.SPEAK_ONLY;
                args.ToSpeak = "Action in progress. No command accepted except for STOP!";
            }
            return args;
            
        }
    }
}
